//
//  ShowQRcodeView.m
//  AILock
//
//  Created by 谭亚明 on 2020/6/28.
//  Copyright © 2020 tym. All rights reserved.
//

#import "AddFamilyView.h"
#import "SGQRCodeObtain.h"
#import "UIView+ZFFrame.h"
#import "NSString+Option.h"
#import "Sizes.h"
#import "UIButton+Gradient.h"
#import "UserTool.h"
#import "UserModel.h"
@interface AddFamilyView()
@property(nonatomic,weak) IBOutlet UIView *conView;

@end

@implementation AddFamilyView

-(void)awakeFromNib{
    [super awakeFromNib];

    self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
    self.conView.layer.cornerRadius = 14.5;
    self.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight);
}

-(IBAction)cancelAction:(id)sender{
    
    [self removeFromSuperview];
}

-(IBAction)createFamilyAction:(id)sender{
    [self removeFromSuperview];
    
    if (self.AddFamilyActionBlock) {
        self.AddFamilyActionBlock(1);
    }
}

-(IBAction)jodinFamilyAction:(id)sender{
    [self removeFromSuperview];
    if (self.AddFamilyActionBlock) {
        self.AddFamilyActionBlock(2);
    }
}

-(void)dealloc{
    NSLog(@"提示框释放");
}

+(void)showAddFamilyActionCompletion:(void(^)(NSInteger actionType))completion{
    
    AddFamilyView *view = [[[NSBundle mainBundle] loadNibNamed:@"AddFamilyView" owner:self options:nil] lastObject];
    
    view.AddFamilyActionBlock = completion;
    UIWindow *keyWindow = [[[UIApplication sharedApplication] windows] firstObject];
    [keyWindow addSubview:view];
}



/*
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.
 - (void)drawRect:(CGRect)rect {
 // Drawing code
 }
 */

@end
